/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.comeval.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author LUISA
 */
@Entity
@Table(name = "pqrs")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pqrs.findAll", query = "SELECT p FROM Pqrs p"),
    @NamedQuery(name = "Pqrs.findByCodigopqrs", query = "SELECT p FROM Pqrs p WHERE p.codigopqrs = :codigopqrs"),
    @NamedQuery(name = "Pqrs.findByFechapqrs", query = "SELECT p FROM Pqrs p WHERE p.fechapqrs = :fechapqrs"),
    @NamedQuery(name = "Pqrs.findByTipopqrs", query = "SELECT p FROM Pqrs p WHERE p.tipopqrs = :tipopqrs"),
    @NamedQuery(name = "Pqrs.findByDescripcionpqrs", query = "SELECT p FROM Pqrs p WHERE p.descripcionpqrs = :descripcionpqrs")})
public class Pqrs implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "codigopqrs")
    private Integer codigopqrs;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "fechapqrs")
    private String fechapqrs;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "tipopqrs")
    private String tipopqrs;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "descripcionpqrs")
    private String descripcionpqrs;
    @JoinColumn(name = "remitentepqrs", referencedColumnName = "documentonitpersona")
    @ManyToOne(optional = false)
    private Persona remitentepqrs;

    public Pqrs() {
    }

    public Pqrs(Integer codigopqrs) {
        this.codigopqrs = codigopqrs;
    }

    public Pqrs(Integer codigopqrs, String fechapqrs, String tipopqrs, String descripcionpqrs) {
        this.codigopqrs = codigopqrs;
        this.fechapqrs = fechapqrs;
        this.tipopqrs = tipopqrs;
        this.descripcionpqrs = descripcionpqrs;
    }

    public Integer getCodigopqrs() {
        return codigopqrs;
    }

    public void setCodigopqrs(Integer codigopqrs) {
        this.codigopqrs = codigopqrs;
    }

    public String getFechapqrs() {
        return fechapqrs;
    }

    public void setFechapqrs(String fechapqrs) {
        this.fechapqrs = fechapqrs;
    }

    public String getTipopqrs() {
        return tipopqrs;
    }

    public void setTipopqrs(String tipopqrs) {
        this.tipopqrs = tipopqrs;
    }

    public String getDescripcionpqrs() {
        return descripcionpqrs;
    }

    public void setDescripcionpqrs(String descripcionpqrs) {
        this.descripcionpqrs = descripcionpqrs;
    }

    public Persona getRemitentepqrs() {
        return remitentepqrs;
    }

    public void setRemitentepqrs(Persona remitentepqrs) {
        this.remitentepqrs = remitentepqrs;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigopqrs != null ? codigopqrs.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pqrs)) {
            return false;
        }
        Pqrs other = (Pqrs) object;
        if ((this.codigopqrs == null && other.codigopqrs != null) || (this.codigopqrs != null && !this.codigopqrs.equals(other.codigopqrs))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.comeval.modelo.Pqrs[ codigopqrs=" + codigopqrs + " ]";
    }
    
}
